import Vue from 'vue'
import Router from 'vue-router'
import Index from '../components/index/Index'
import Friends from '../components/index/Friends'
import Space from '../components/index/Space'
import Choose from '../components/chooseList/ChooseList'
import  Map from '../components/map/Map'
import Filter from '../components/index/Filter'
Vue.use(Router) //安装插件

export default new Router({

  mode: 'hash',
  routes: [
    //第一条路由
    {
      path: '/index',
      name:'index',
      component:  Index
    },
    {
      path: '/',
      name:'index',
      component: resolve => require(['../components/index/Index'],resolve)
    },
    {
      path: "/filter",
      name: 'filter',
      //意思就是在此页面只解析当前页面
      component:  resolve => require(['../components/index/Filter'],resolve)
    },
    {
      path: '/Choose',
      name: 'choose',
      component: resolve => require(['../components/chooseList/ChooseList'],resolve),
    },
    {
      path: '/friends',
      name: 'friends',
      component: Friends
    },
    {
      path: '/space',
      name: 'space',
      component: Space
    },
    {
      path: '/Map/:areaid',
      name: 'map',
      component: resolve => require(['../components/map/Map'],resolve),
    }
  ]
})
